package com.yy.chapter6.vo;

import com.yy.chapter6.validation.MyValid;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.Valid;
import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.Min;
import java.io.Serializable;

/**
 * @author yangyao
 * @Description: Test实体类
 * @date 2018/10/23 09:31
 */
public class Test implements Serializable {

    @NotBlank
    @Length(min = 6,max = 16)
    private String userName;

    @NotBlank
    @Email
    private String email;

    @Min(value = 1)
    private int age;

    @AssertTrue
    private Boolean status;

    @MyValid(values = "a,c,f")
    private String temp;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public String getTemp() {
        return temp;
    }

    public void setTemp(String temp) {
        this.temp = temp;
    }
}
